package com.tvunetworks.center.user.service;

import com.github.pagehelper.PageInfo;
import com.tvunetworks.center.common.model.LoginUser;
import com.tvunetworks.center.user.model.Feature;
import com.tvunetworks.center.user.model.param.AddFeatureParam;
import com.tvunetworks.center.user.model.vo.FeatureVo;

import java.util.List;
import java.util.Map;
/**
 * @program: tvucc-aggregator
 * @author lebronchen
 * @create: 2020-04-24 13:17
 **/
public interface FeatureService {


    /**
     *
     * @param feature feature
     * @return Feature
     */
    Feature getByFeature(String feature);

    /**
     *
     * @param id id
     * @return Feature
     */
    Feature getById(String id);


    /**
     *
     * @return List
     */
    List<FeatureVo> listAll();

    /**
     * Admin默认拥有的feature
     * @return List
     */
    List<FeatureVo> listAdminAutoOwnFeature();

    /**
     * 非Admin默认拥有的feature
     * @return List
     */
    List<FeatureVo> listNotAdminAutoOwnFeature();


    /**
     * 列出用户可以为孩子创建的feature
     * 用于创建用户时 可勾选列表
     * @param loginUser loginUser
     * @param role role
     * @param ownerId ownerId
     * @return Map
     */
    Map<String, List<FeatureVo>> listFeatureForCreate(LoginUser loginUser, String role, String ownerId);

    /**
     * Support，Admin为孩子点击修改权限页面，可以选择的feature
     * @param loginUser      登陆用户
     * @param modifyUserId   被修改权限的用户
     * @return Map
     */
    Map<String, List<FeatureVo>> listFeatureForModify(LoginUser loginUser, String modifyUserId);


    /**
     *
     * @param param param
     * @return int
     */
    int addFeature(AddFeatureParam param);

    /**
     *
     * @param id id
     * @param param param
     * @return int
     */
    int updateFeature(String id, AddFeatureParam param);

    /**
     *
     * @param id id
     * @return int
     */
    int deleteFeature(String id);

    /**
     *
     * @param pageNum pageNum
     * @param pageSize pageSize
     * @return PageInfo
     */
    PageInfo<FeatureVo> pageFeature(int pageNum, int pageSize);


}
